<!DOCTYPE html>
<html>
<head>
    <title>后台管理中心</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="${ctxPath}/assets/login/css/style.css" rel="stylesheet" type="text/css" />
    <link href="${ctxPath}/assets/login/css/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="${ctxPath}/assets/login/css/styles1.css" title="styles1" media="screen" >
    <link rel="alternate stylesheet" type="text/css" href="${ctxPath}/assets/login/css/styles2.css" title="styles2" media="screen" >
    <link rel="alternate stylesheet" type="text/css" href="${ctxPath}/assets/login/css/styles3.css" title="styles3" media="screen" >
    <link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}">
    <link rel="stylesheet" href="${ctxPath}/assets/common/css/login.css?v=${constants.getReleaseVersion()}" media="all">
    <script type="text/javascript" src="${ctxPath}/assets/login/js/jquery.min.js"></script>
    <script type="text/javascript" src="${ctxPath}/assets/login/js/styleswitch.js"></script>
    <script type="text/javascript" src="${ctxPath}/assets/login/css/Particleground.js"></script>
    <style type="text/css">html,body{height: 100%;position: relative;}</style>
    <script>
        $(document).ready(function() {
            $('body').particleground({
                dotColor: 'rgba(255,255,255,0.2)',
                lineColor: 'rgba(255,255,255,0.2)'
            });
        });
    </script>
    <script>
        if (window != top)
            top.location.replace(location.href);
    </script>
</head>
<body onload="javascript:document.myform.username.focus();" id="canvas">

<div class="admin_login">


    <div  class="layui-card-body layui-form layui-form-pane" lay-filter="loginForm" style="padding: 0px;">

        <div class="admin_title">
            <strong> 用户注册 </strong>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 48px;"><i class="layui-icon layui-icon-username"></i></label>
            <div class="layui-input-inline" style="margin-left: 48px;" >
                <input name="username" id="username" type="text" placeholder="账号" lay-verify="required" class="layui-input"  >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 48px;"><i class="layui-icon layui-icon-password"></i></label>
            <div class="layui-input-block" style="margin-left: 48px;" >
                <input name="password" type="password" id="password" placeholder="密码" lay-verify="required" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <button class="layui-btn layui-btn-fluid" id="submit">立即注册</button>
        </div>
    </div>


</div>

@/* 加入contextPath属性和session超时的配置 */
<script type="text/javascript">
    var Feng = {
        ctxPath: "${ctxPath}",
        version: '${constants.getReleaseVersion()}'
    };
</script>
<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>

<script>

    layui.use(['layer', 'form', 'index', 'ax'], function () {
        var $ = layui.jquery;
        var $ax = layui.ax;
        var layer = layui.layer;
        var form = layui.form;
        var index = layui.index;

        var url = location.search;
        console.log("url===="+url);
        if (url.indexOf("code") != -1) {
            var str = url.substr(1);
            console.log(str);
            var code = str.split("=")[1];
            console.log(code);
        }

        //登录操作
        $('#submit').click(function () {
            var ajax = new $ax(Feng.ctxPath + "/login", function (data) {
                Feng.success("登录成功!");
                index.clearTabCache();
                window.location.href = Feng.ctxPath + "/";
            }, function (data) {
                layer.msg("登录失败！" + data.message, {icon: 5, anim: 6});
            });
            ajax.set("username", $("#username").val());
            ajax.set("password", $("#password").val());
            @if(constants.getTenantOpen()){
                ajax.set("tenantCode", $("#tenantCode").val());
            @}
            @if(constants.getKaptchaOpen()){
                ajax.set("kaptcha", $("#kaptcha").val());
            @}
            ajax.start();
        });

    });
</script>


</body>
</html>
